﻿using System;
using System.Collections.Generic;
using System.Text;
using MyHotel_BUSWS.MyHotel_LoaiPhongDAO_Webservice;
using MyHotel_BUSWS.MyHotel_ThamSoDAO_Webservice;


namespace MyHotel_BUSWS
{
    public class MHQuyDinhBUS
    {
        //--------------Loai Phong-------------------//
        public static LoaiPhong[] getListLoaiPhong()
        {
            LoaiPhongDAOWSSoapClient ws = new LoaiPhongDAOWSSoapClient();
            return ws.getList();
        }

        public static bool themLoaiPhong(LoaiPhong loaiphong)
        {
            LoaiPhongDAOWSSoapClient ws = new LoaiPhongDAOWSSoapClient();
            if (ws.CheckLoaiPhongByTenLoai(loaiphong.TenLoai) == true)
                return false;
            return ws.themLoaiPhong(loaiphong);
        }

        public static bool capNhatLoaiPhong(LoaiPhong loaiphong)
        {
            LoaiPhongDAOWSSoapClient ws = new LoaiPhongDAOWSSoapClient();
            if (ws.CheckLoaiPhongByTenLoai_MaLoai(loaiphong.TenLoai, loaiphong.MaLoai) == true)
                return false;
            return ws.capNhatLoaiPhong(loaiphong);
        }

        public static bool xoaLoaiPhong(LoaiPhong loaiphong)
        {
            LoaiPhongDAOWSSoapClient ws = new LoaiPhongDAOWSSoapClient();
            if (ws.CheckPhongByMaLoai(loaiphong.MaLoai) == true)
                return false;
            return ws.xoaLoaiPhong(loaiphong);
        }
        
        
        
    }
}
